<?php
/**
 * Created by litong on Date: 2018/12/22 0022 下午 12:36
 */
$test="litong";
$username=isset($test)?$test:"nobody";
echo $username,PHP_EOL;

//PHP 5.3+版本写法
$username=$test?:"nobody";
echo $username,PHP_EOL;
?>